function getXmlHttpRequest() {
//	xmlhttp=false;
//	this.AjaxFailedAlert = "Su navegador no soporta las funcionalidades de este sitio y podria experimentarlo de forma diferente a la que fue pensada. Por favor habilite javascript en su navegador para verlo normalmente.\n";
//	this.requestFile = file;
//	this.encodeURIString = true;
//	this.execute = false;
	if (window.XMLHttpRequest) { 
		xhr = new XMLHttpRequest();
		if (xhr.overrideMimeType) {
			xhr.overrideMimeType('text/xml');
		}
	}
	else if (window.ActiveXObject) { // IE
			try {
				xhr = new ActiveXObject("Msxml2.XMLHTTP");
			}catch (e) {
				try {
					xhr = new ActiveXObject("Microsoft.XMLHTTP");
				} catch (e) {
				xhr = false;
				   alert("Votre navigateur ne supporte pas cette fonctionalite");
				}
			}

	}
	//return xhr ;
}


function getXmlHttpRequest2() {
//	xmlhttp=false;
//	this.AjaxFailedAlert = "Su navegador no soporta las funcionalidades de este sitio y podria experimentarlo de forma diferente a la que fue pensada. Por favor habilite javascript en su navegador para verlo normalmente.\n";
//	this.requestFile = file;
//	this.encodeURIString = true;
//	this.execute = false;
	if (window.XMLHttpRequest) { 
		var xhr2 = new XMLHttpRequest();
		if (xhr2.overrideMimeType) {
			xhr2.overrideMimeType('text/xml');
		}
	}
	else if (window.ActiveXObject) { // IE
			try {
				var xhr2 = new ActiveXObject("Msxml2.XMLHTTP");
			}catch (e) {
				try {
					var xhr2 = new ActiveXObject("Microsoft.XMLHTTP");
				} catch (e) {
				xhr = false;
				   alert("Votre navigateur ne supporte pas cette fonctionalite");
				}
			}

	}
	return xhr2 ;
}

/********************************************************************************************/
/* AHAH functions by Phil Ballard                                                           */
/* This code is intended for study purposes.                                                */
/* You may use these functions as you wish, for commercial or non-commercial applications,  */
/* but please note that the author offers no guarantees to their usefulness, suitability or */
/* correctness, and accepts no liability for any losses caused by their use.                */
/********************************************************************************************/

function callAHAH(url, pageElement, callMessage, errorMessage) {
     document.getElementById(pageElement).innerHTML = callMessage;
     try {
     req = new XMLHttpRequest(); /* e.g. Firefox */
     } catch(e) {
       try {
       req = new ActiveXObject("Msxml2.XMLHTTP");  /* some versions IE */
       } catch (e) {
         try {
         req = new ActiveXObject("Microsoft.XMLHTTP");  /* some versions IE */
         } catch (E) {
          req = false;
         } 
       } 
     }
     req.onreadystatechange = function() {responseAHAH(pageElement, errorMessage);};
     req.open("GET",url,true);
     req.setRequestHeader('X_REQUESTED_WITH-Type','XMLHttpRequest');
     req.send(null);
  }

function responseAHAH(pageElement, errorMessage) {
   var output = '';
   if(req.readyState == 4) {
      if(req.status == 200) {
         output = req.responseText;
         document.getElementById(pageElement).innerHTML = output;
         } else {
         document.getElementById(pageElement).innerHTML = errorMessage+"\n"+output;
         }
      }
  }


//this function create an Array that contains the JS code of every <script> tag in parameter
//then apply the eval() to execute the code in every script collected
function parseScript(strcode) {
var scripts = new Array();         // Array which will store the script's code

//Strip out tags
while(strcode.indexOf("<script") > -1 || strcode.indexOf("</script") > -1) {
var s = strcode.indexOf("<script");
var s_e = strcode.indexOf(">", s);
var e = strcode.indexOf("</script", s);
var e_e = strcode.indexOf(">", e);

// Add to scripts array
scripts.push(strcode.substring(s_e+1, e));
// Strip from strcode
strcode = strcode.substring(0, s) + strcode.substring(e_e+1);
}

//Loop through every script collected and eval it
for(var i=0; i<scripts.length; i++) {
try {
 eval(scripts[i]);
}
catch(ex) {
 // do what you want here when a script fails
}
}
}